Composition of Transformations
Introduction
When we apply a geometric or algebraic transformation—like a rotation, reflection, scaling, or shear—we often want to apply more than one in a row.
Matrix multiplication gives us a compact way to combine these steps into a single transformation.
This article explains how and why multiple transformations can be composed using matrices, and how to compute and interpret the results.
Why Compose Transformations?
Some reasons we combine transformations:
- To simplify repeated operations into one matrix.
- To understand how complex motions (rotate + scale + reflect) interact.
- To analyze systems where each step depends on the previous one.
- To reduce computational cost in graphics or simulations.
A sequence like:
can be replaced by one matrix that does all three at once.
Applying Transformations Step-by-Step
Suppose you have a vector $v$ and two transformations:
- First apply matrix $A$
- Then apply matrix $B$
The process is:
- Compute $A v$
- Then compute $B (A v)$
This is often written as: $$v' = B A v$$ Key points:
- The matrix closest to $v$ acts first.
- The order matters: in general, $AB \neq BA$.
- Each transformation “feeds into” the next.
Matrix Multiplication as Composition
When you multiply matrices, you are really combining transformations.
If:
- $A$ scales a vector
- $B$ rotates a vector
Then $BA$ is the transformation that:
- scales first
- rotates second
This is why the order of multiplication is so important.
A helpful mental model
Think of matrices as machines:
- $A$ is a machine that modifies an input vector.
- $B$ is another machine.
Sending $v$ through both machines in order gives: $$v \xrightarrow{A} A v \xrightarrow{B} B(A v)$$ The combined machine is $BA$.
Examples of Composition
Example 1: Scaling then rotating
Let $$A = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}, \quad B = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$
- $A$ doubles the size of a vector.
- $B$ rotates a vector by $90^\circ$.
The combined transformation is: $$BA = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 0 & -2 \\ 2 & 0 \end{pmatrix}$$
Example 2: Reflection then shear
Let $R$ reflect across the $x$-axis and $S$ shear horizontally.
Then $SR$ means:
- reflect
- shear
But $RS$ means:
- shear
- reflect
These produce different results—composition is not commutative.
Geometric Interpretation
When composing transformations:
- Rotations add their angles (if centered at the origin).
- Scalings multiply their scale factors.
- Reflections flip orientation; two reflections may produce a rotation.
- Shears distort shapes; combining shears can mimic rotation or scaling.
Composition lets us build complex transformations from simple ones.
Exercises
- Let
$A = \begin{pmatrix}2 & 0 \\ 0 & 1\end{pmatrix}$
and
$B = \begin{pmatrix}1 & 1 \\ 0 & 1\end{pmatrix}$.
Compute $BA$. - Apply $A$ then $B$ to the vector $v = (3,1)$ using the same matrices as above.
- Suppose $R$ is a $90^\circ$ rotation matrix and $S$ is a scaling matrix with factor $3$.
Write the combined transformation matrix $RS$. - True or false: If $A$ and $B$ are both reflections, then $AB$ is always a reflection.
- Let
$C = \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}$
and
$D = \begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}$.
Compute $DC$. - Describe in words what it means for $BA$ to represent “first apply $A$, then apply $B$.”
- Compute the composition $$\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}$$